Talk:UBASIC/TutorialScratchpad
TutorialScratchpad Help: talk pages, talk page guidelines Av&Tv Commands That are very handy commands, thanks for finding out! Now if we only could read out in "M" mode what the cam thinks are the best settings for Av and Tv, we could make a script where it sets the right values automatically for us. Since the CHDK I use "M" mode so much, because fixed aperture and time values are great if you use the histogram to get the optimal exposure. But it really bugs me that I have to try so much to get the right exposure, because the cam only tells me "-2" till "+2", but not the correct exposure right away. --Harvester 19:26, 17 May 2007 (UTC) :Nice to see you guys finding those values for the these commands found in the source code (I'm still not sure about the MOD and CALL ones though, no reply to my questions about them on the main uBASIC talk page). I put the first list of values you people found in a table, because I couldn't see it properly formatted in my browswer. Then I checked into more Wiki formatting commands (found another nice total list here How to edit a page, and couldn't get the monospace (typewriter/tt) fonts working on my browser. Come to find out I had replaced that font in my settings. Oooops. Now the pre-formatted text shows up just fine. Should I undo the table I made or just leave it in case others can't display a monospace font properly? :Keoeeit 00:21, 18 May 2007 (UTC) ::MOD is just the name of reminder (%). CALL is not used at all. -- GrAnd 07:52, 19 May 2007 (UTC) :::Regarding the table: I think both formats are okay. Perhaps I like the shorter format a little bit more and you can copy&paste it better into a text file, so I changed it back (if it is okay for you). --Harvester 08:17, 19 May 2007 (UTC) ::::re: MOD & CALL, thanks GrAnd. I kind of thought that's what the MOD was for but wasn't sure. I'll try to not add any "call" commands to my scripts too. :-) Then again ... a print "Call 1-800-BUY-CHDK" as a subliminal ad in every 15th intervalometer shot might work. :-) ::::re: Table, yep, looks much nicer. The more I saw that blunder the more I saw the blunder by trying a table to fix a font problem on my end. If nothing else, I learned lots of cool stuff about making tables in Wiki-speak. :-) Manual focus button on S3 IS Any chance of the manual focus button on the S3 IS getting a command? It is very hard to keep the camera absolutely still while holding down the MF button. 207.216.12.82 18:51, 18 May 2007 (UTC) Operations order Keoeeit, you said: :Normally we assume that operations such as * and / will be performed before any + and - operations. This is not the case in this uBASIC. You will have to be careful on what order you put your math operations. Do you have the example in which you got the incorrect result? I've tested a lot of variants of combinations of math operations and as for me they work absolutely correctly. FYI... Order of operations --GrAnd 12:18, 19 May 2007 (UTC) ::Well, I don't have any examples anymore. You fixed what was causing the problem. :-) I was having a rough time trying to sort out a way to get those math expressions to work in a Print statement. And that's what lead to my belief that there was a problem with the math operation hierarchy. And yes, I realized after I wrote which came first + - or * / that I had them backwards, but wasn't quite sure. Math class was over 30 years ago. I've devoted those brain-cells to new things since then. :-) (Or lost them along the way, which always raises an interesting question, how can the brain know when it has brain-damage? Paradox. :-) ) ::I'll check the tutorial math section and remove that portion that warns of math operation disorder now. And I could simplify my intervalometer script now too, now that the print + math commands is fixed. I really should add in a complete "total time =" command figuring in shutter-speed too, now that the get_tv values are known, but it might be a tight fit to get that all under 2K with a shutter-speed table. I wonder if there's a simple way to compute shutter speed directly from the tv value? ::What might be handy is if we start a bank of commonly used subroutines that anyone could just dump into a program, shutter-speeds computed from get_tv might be a good one for that. Ex: my count-down timer subroutine in the Ultra-Intervalometer script might come in handy for others. Keoeeit 14:53, 20 May 2007 (UTC) Logic Expressions I'd like to add a section in the tutorial on how to use the &, |, and ^ (and, or, xor) commands, but I'm not quite sure I could do it properly. (My BASIC being pretty rusty.) But for the sake of argument, can these commands be used in situations like: :if a=1 & b=1 then gosub "both_must_be_true" :if a=1 | b=1 then gosub "any_are_true" :if a=1 ^ b=1 then gosub "only_one_is_true" And can these be used in more elaborate truth conditions, such as: :if a=1 & (b=3 | c=2) ^ d=1 then z=3 & y=5 else gosub "subroutine" ??? And do these also have an operation hierarchy? (priority of operation) Keoeeit 14:52, 20 May 2007 (UTC) :These operations (and, or, xor) are not logic. They are binary. --GrAnd 15:09, 20 May 2007 (UTC) IAQ - Infrequently Asked Questions :-) Is there (or will there be) any way that a script could detect which camera model it is being ran on? I'd like to modify the Ultra Intervalometer script to have one more toggle so it would engage single-frame shooting or video mode (now that the S cameras have those commands), but it would be nice if when that is engaged it would go to the proper subroutine per camera model to engage video mode. With something like: if i=1 then gosub "axvideo" else shoot if j=1 then gosub "sxvideo" else shoot Then again, if there's no way to detect camera model, there could be one user-value set as 0, 1, or 2, for single-frame, A-series Video, or S-series Video, or would that be too confusing for the end user? I wonder if one more subroutine to trigger the camera's own timer would be overkill and redundant? So many possibilities to play with now! (Plus the discipline of trying to keep it all under 2K.) Keoeeit 06:19, 27 May 2007 (UTC)